package com.hz.springboot01.controller;


import com.hz.springboot01.service.ProviderService;
import com.hz.springboot01.util.ResultJSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@RequestMapping("/pro")
public class ProviderController {
    //调用service
    @Autowired
    private ProviderService providerService;

    /**
     * 根据id查找供应商信息
     * @param pid
     * @return
     */
    @ResponseBody
    @RequestMapping("/findProviderById/{pid}")
    public ResultJSON findProviderById(@PathVariable("pid") Integer pid) {
        return providerService.findProviderById(pid);
    }

}
